-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bus/nes: Improved emulation of a SMB3 bootleg. #8308
Conversation
0kmg
commented
Jul 16, 2021
- Corrected IRQ behavior. Fixes almost all flickering on status bar divider line.
- Corrected various minor details that don't affect emulation but are accurate to PCB.
- PRG ROM is on two DIPs. Split image to reflect that.
Note: this patch removes all flickering on the divider line AFAICT except on the map screen where it introduces a momentary flicker on the right side. Both this set and another unrelated pirate, smb3h1, have an erroneous line here. Also all other SMB3 sets have some minor flicker on the right side in the same spot. Since there are 3 distinct devices represented amongst all these sets and all have issues with the map screen divider line I suspect a common cause elsewhere. |
- Corrected IRQ behavior. Fixes almost all flickering on status bar divider line. - Corrected various minor details that don't affect emulation but are accurate to PCB. - PRG ROM is on two DIPs. Split image to reflect that.
91c1fd1
to
3c3c0db
Compare
hash/nes.xml
Outdated
<description>Super Mario Bros. 3 (Pirate)</description> | ||
<year>19??</year> | ||
<publisher><pirate></publisher> | ||
<info name="alt_title" value="Super 超級三代 3"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the game actually use the English title “Super Mario Bros. 3” or does it only use the Chinese title. Is the Chinese title correct? It seems to be a tautology, like “Super Super Three Generations 3” (the English “Super” and “3” doubling up with the Chinese).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language crossing borders is funny like that. I always think of the American baseball team "The Los Angeles Angels". Anyway, I don't think it retains the English title anywhere (though I have no photos of cart/box/etc), and this is what comes up on loading the game. It's the one pirate cart that graphically hacks the title screen and replaces just the second line "Mario" with "超級三代".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So are you saying the title screen looks something like this?
Super
超級三代 Bros.
3
In that case, the description should be “Super Chaoji Sandai Bros. 3 (bootleg)” or something, and the alt_title
should be “Super 超級三代 Bros. 3”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, “The La Brea Tar Pits” – “The The Tar Tar Pits” :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more careful. The original game title on-screen has "Mario Bros." on the second line. The Chinese bootleg replaces the middle line so it looks like:
Super
超級三代
3
Updated.
src/devices/bus/nes/bootleg.cpp
Outdated
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; | ||
prg8_89((m_prg_chunks << 1) - 1); | ||
prg8_ab(0); | ||
prg8_cd(0); | ||
prg8_ef((m_prg_chunks << 1) - 1); | ||
chr8(0, m_chr_source); | ||
|
||
m_irq_enable = 0; | ||
m_irq_count = 0; | ||
// registers not cleared or initialized at reset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you’re not clearing on reset, do you need to move stuff to start to ensure it begins in a deterministic state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I looked into this a bit more. The short of it is that everyª 8K code bank has the same reset vector code which immediately points 0x8000 to somewhere, jumps there, and sets things to a sane state. The PCB is odd for a NES cart and is loaded with discrete circuits.
ª Except for one page. Game will fail if bank 24 is loaded into 0xE000 at power up/reset.
So there are at least two options:
(1) Don't be explicit, rely on how nes_slot.cpp initializes things (PRG and CHR banks set to start of ROMs I believe), and it will just work based on the common reset vectors. This option is what the current proposed change with the above empty pcb_reset does.
(2) Be explicit. Override nes slot's pcb_start function, not seen here, and initialize once there. device_start can't be used because prg8_xx helpers access stuff that gets initialized later by pcb_start (i.e. we'd segfault in device_start). NesDev reverse engineering does say that registers on the board reliably power on with all 0xFF. This option documents the best-to-date knowledge of the PCB (but effectively does the same as (1) after a few machine cycles due to the common reset vectors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went all executive and explicitly initialized things with choice (2). It only adds a few lines of mostly boilerplate.